package com.pearl.jacksonspringboot.demo.dict;

/**
 * @author TD
 * @version 1.0
 * @date 2024/3/21
 */
public enum GenderEnum implements CommonEnum {

    MAN(1, "男"),

    WOMAN(2, "女");

    GenderEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;

    private String desc;

    @Override
    public String getDescription(int code) {
        for (GenderEnum c : GenderEnum.values()) {
            if (c.getCode() == code) {
                return c.getDesc();
            }
        }
        return "";
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}